﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SQLite;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MyWords
{
    
    public partial class Form2 : Form
    {
        public CurrentUser user;


        public Form2()
        {
            //this.user = currentUser;
            InitializeComponent();
        }
        private void Form2_Load(object sender, EventArgs e)
        {
            
        }

        private void btn_login_Click(object sender, EventArgs e)
        {
            string username = text_username.Text;
            string password = text_password.Text;
            user = new CurrentUser();
            if (user.login(username, password))
            {
                MessageBox.Show("登录成功！" + username);
                // 跳转到背单词主界面
                this.DialogResult = DialogResult.OK;
                this.Dispose(); // 释放资源
                this.Close();   // 关闭窗口
            }
            else MessageBox.Show("登陆失败！！请检查密码是否正确或用户名是否存在！！");
        }
    }
}
